<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../include/meta.jsp"/>
    <title>${info.title} - <smt:dict code="company.name"/></title>
    <style>

        body {
            overflow: auto !important;
            font-family: "Microsoft YaHei" ! important;
        }

        #contentDiv {
            padding: 1em 0;
        }

        #contentDiv h3 {
            padding: 10px 0;
            font-weight: bold;
            color: #666;
        }

        #contentDiv h3 span {
            padding-bottom: 3px;
            border-bottom: solid #ff6600 2px;
            display: inline-block;
        }

        #contentDiv p {
            line-height: 1.5em;
            color: #666;
        }


        @media (max-width: 991px) {

            #contentDiv img {
            	width: 100%!important;
    			height: auto !important;
            }
        }
        
    </style>
</head>
<body class="page-secondary">
<jsp:include page="../include/navbar.jsp"/>
<div id="banner-re" class="hidden-md-down" style="text-align: center;">
    <img src="upload/images/${info.type.code.replace('.', '_')}.jpg" class="img-fluid">
</div>
<div id="re-nav-bar">
    <div class="container">
        <div class="row">
            <c:forEach var="theMenu" items="${menuList}">
                <c:choose>
                    <c:when test="${theMenu.id eq curMenu.id}">
                        <div class="col-6 col-md-3 re-nav-bar-item active"><a href="#">${theMenu.name}</a></div>
                    </c:when>

                    <c:otherwise>
                        <div class="col-6 col-md-3 re-nav-bar-item">
							<a href="${theMenu.url}<c:if test="${!theMenu.url.contains('?')}">?curMenuId=${theMenu.id}</c:if>">${theMenu.name}</a></div>
                    </c:otherwise>
                </c:choose>
            </c:forEach>
        </div>
        </ul>
    </div>
</div>
<div class="container" style="padding-top: 20px">
    <span class="h2">${info.title}</span>
    <ul class="breadcrumb hidden-md-down">
        <c:forEach var="theMenu" items="${menuChain}">
            <li><a href="${theMenu.url}<c:if test="${!theMenu.url.contains('curMenuId')}">?curMenuId=${theMenu.id}</c:if>">${theMenu.name}</a></li>
        </c:forEach>
    </ul>
    <hr>

    <section id="contentDiv">
        ${info.contentUnEscaped}
    </section>
	<c:if test="${info.type.code ne 'spec.family'}">
    <div style="padding: 2.5em 0">
    	<c:choose>
    		<c:when test="${info.type.code eq 'spec.realestate'}"><div class="h4">置业评估表</div></c:when>
    		<c:otherwise><div class="h4">移民评估表</div></c:otherwise>
    	</c:choose>
        <p class="text-muted" style="font-size: 14px">我们承诺会对您的个人信息严格保密，不用于任何商业用途</p>
        <form class="form-horizontal re-form" onsubmit="return false;" role="form" style="    padding-bottom: 60px;
    padding-right: 60px;">
        	<div class="row">
                <div class="col-12 col-lg-4">
                    <div class="form-group row">
                        <label for="name" style="padding-top: 5px;" class="col-3 control-label">姓名: </label>
                        <input type="text" class="col-9 form-control" id="name" name="name" />
                    </div>
                </div>
                <div class="col-12 col-lg-4">
                    <div class="form-group row">
                        <label for="mobile" style="padding-top: 5px;" class="col-3 control-label">手机: </label>
                        <input type="text" class="col-9 form-control" id="mobile" name="mobile" />
                    </div>
                </div>
                <div class="col-12 col-lg-4">
                    <div class="form-group row">
                        <label for="city" style="padding-top: 5px;" class="col-3 control-label">城市: </label>
                        <input type="text" class="col-9 form-control" id="city" name="city" />
                    </div>
                </div>
			</div>
            <div class="row">
                <div class="col-12">
                    <div class="form-group row">
                        <label for="detail" style="padding-top: 10px;" class="col-3 col-lg-1 control-label">留言: </label>
                        <textarea style="border-radius: 0" class="form-control col-9 col-lg-11" id="detail" name="detail"></textarea>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-12" style="padding: 0">
                    <button type="button" id="btnSubmit" onclick="doSubmit();" class="btn btn-default">立即提交</button>
                </div>
            </div>
        </form>
    </div>
    </c:if>
</div>
<jsp:include page="../include/footer.jsp"/>
</body>
</html>
<script>
$('h3').each(function () {
    var sectionHeader = '<span>' + $(this).html() + '</span>';
    $(this).html(sectionHeader);
});

function doSubmit() {
    var name = $('#name').val();
    var mobile = $('#mobile').val();
    var city = $('#city').val();
    if (name == '') {
        alert('请输入您的姓名');
        return;
    }

    if (mobile == '' || !/\d{11,11}/.test(mobile)) {
        alert('请输入您的手机号码');
        return;
    }

    if (city == '') {
        alert('请输入所在的城市');
        return;
    }

    $.ajax({
        url: 'userInfo/add',
        type: 'post',
        data: {'name': name, 'mobile': mobile, 'city': city, 'channel': document.location.href},
        success: function (data) {
            $('#name').val('');
            $('#mobile').val('');
            $('#city').val('');
            alert('提交成功, 请保持手机畅通, 工作人员会联系你.');
        },
        error: function () {
            alert('操作失败, 请稍后重试');
        }
    })
};

var menuChain = [
<c:forEach var="theMenu" items="${menuChain}">
'${theMenu.id}',
</c:forEach>
''
];

$('#menu > li > a').each(function(){
	if($(this).attr('menuId')== menuChain[1]) {
		$(this).parent().addClass('active');
	}
});

</script>